<?php

namespace App\Http\Controllers\Mobile\Index;
use App\Models\Admin\AreaStation;
use App\Models\News\News;
use Illuminate\Http\Request;
use Style;

class IndexController extends CommonController{

    /**
     * 一网cms手机首页
     * @param Request $request
     * @return mixed
     */
    public function index($station=null){
        if(!empty($station)){
            $station = AreaStation::where('station_sign',$station)->first();
        }
        $jobarea = (!empty($station->station_cid)) ? '&jobarea1='.$station->station_cid : '';
        $news = News::select('id','title')->orderBy('updated_at','desc')->take(2)->get();
        return Style::view('mobile.index.index',compact('jobarea','ename','news','station'));
    }

    /**
     * 职位搜索
     * @return mixed
     */
    public function popularSearch(){
        return Style::view('mobile.index.popularSearch');
    }

    /**
     * 登录选择
     * @return mixed
     */
    public function vipLogin(){
        return Style::view('mobile.index.vipLogin');
    }


}